package helper

type XmlString string

func (xs *XmlString) Xml(key, value string) *XmlString {
	*xs += "<" + XmlString(key) + ">" + XmlString(value) + "</" + XmlString(key) + ">"
	return xs
}

func (xs *XmlString) BeginXml(mesCode string) *XmlString {
	*xs += `<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dhcc="http://www.dhcc.com.cn">
   <soapenv:Header/>
   <soapenv:Body>
       <dhcc:HIPMessageServer>
           <!--Optional:-->
           <dhcc:input1>` + XmlString(mesCode) + `</dhcc:input1>
           <!--Optional:-->
           <dhcc:input2>
               <![CDATA[<Request>`
	return xs
}

func (xs *XmlString) EndXml() *XmlString {
	*xs += `</Request>]]>
           </dhcc:input2>
       </dhcc:HIPMessageServer>
   </soapenv:Body>
</soapenv:Envelope>`
	return xs
}

func (xs *XmlString) ReportXml(value string) *XmlString {
	*xs += XmlString(value)
	return xs
}

func (xs *XmlString) ReportBeginXml(mesCode string) *XmlString {
	*xs += `<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dhcc="http://www.dhcc.com.cn">
   <soapenv:Header/>
   <soapenv:Body>
       <dhcc:HIPMessageServer>
           <!--Optional:-->
           <dhcc:input1>` + XmlString(mesCode) + `</dhcc:input1>
           <!--Optional:-->
           <dhcc:input2>
               <![CDATA[<Request>
					<Header>
						<SourceSystem></SourceSystem>
						<MessageID></MessageID>
					</Header>
					<Body>
						<DocumentRetrievalRt>`
	return xs
}

func (xs *XmlString) ReportEndXml() *XmlString {
	*xs += `
</DocumentRetrievalRt>
					</Body>
</Request>]]>
           </dhcc:input2>
       </dhcc:HIPMessageServer>
   </soapenv:Body>
</soapenv:Envelope>`

	return xs
}

func (xs *XmlString) FeeListBeginXml(mesCode string) *XmlString {
	*xs += `<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org">
   <soapenv:Header/>
   <soapenv:Body>
      <tem:TPAPPEntrance>
         <tem:IFName>REY</tem:IFName>
         <tem:MCode>` + XmlString(mesCode) + `</tem:MCode>
         <tem:Input><![CDATA[
						<Parms>`
	return xs
}

func (xs *XmlString) FeeListEndXml() *XmlString {
	*xs += `</Parms>
					  ]]></tem:Input>
         <tem:Exp></tem:Exp>
      </tem:TPAPPEntrance>
   </soapenv:Body>
</soapenv:Envelope>`
	return xs
}

func (xs *XmlString) FeeListDetailBeginXml(mesCode string) *XmlString {
	*xs += `<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org">
   <soapenv:Header/>
   <soapenv:Body>
      <tem:TPAPPEntrance>
         <tem:IFName>REY</tem:IFName>
         <tem:MCode>` + XmlString(mesCode) + `</tem:MCode>
         <tem:Input><![CDATA[
					<Parms>`
	return xs
}

func (xs *XmlString) FeeListDetailEndXml() *XmlString {
	*xs += `</Parms>]]>
					</tem:Input>
         <tem:Exp></tem:Exp>
      </tem:TPAPPEntrance>
   </soapenv:Body>
</soapenv:Envelope>`
	return xs
}

func (xs *XmlString) OperaBeginXml(mesCode string) *XmlString {
	*xs += `<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org">
   <soapenv:Header/>
   <soapenv:Body>
      <tem:TPAPPEntrance>
         <tem:MCode>` + XmlString(mesCode) + `</tem:MCode>
         <tem:Input><![CDATA[
						<Parms>`
	return xs
}

func (xs *XmlString) OperaEndXml() *XmlString {
	*xs += `</Parms>
					  ]]></tem:Input>
      </tem:TPAPPEntrance>
   </soapenv:Body>
</soapenv:Envelope>`
	return xs
}
